<include file="public/header" />
<link rel="stylesheet"  href="__ADMIN__/css/global.css">
<link rel="stylesheet"  href="__ADMIN__/css/master.css"   type="text/css" />
<link rel="stylesheet"  href="__ADMIN__/css/jquery.treeTable.css"  type="text/css" />
</head>
<body style="background: #fff;">
<div class="admin-main">
	<blockquote class="layui-elem-quote">
		<form class="layui-form" action="{:url('Admin/user')}" method="get" >
			<div class="layui-inline layui-wd0" >
				<select name="role_id" >
				  	<option value="0" >全部权限角色</option>
					<foreach name="role"  key="k" item="vo">
						<option value="{$vo}" <if  condition="$formget.role_id eq $k"> selected="selected" </if>>{$vo}</option>
					</foreach>
				</select>     
			</div>
			<div class="layui-inline ml10">
				<div class="layui-input-inline layui-wd0" >
				  <input type="text" name="user_login" value="{$formget.user_login}" placeholder="按登录账号或昵称搜索" class="layui-input">
				</div>
			</div>
	
		      <div class="layui-input-inline ml10 layui-wd" >
		        <input type="text" class="layui-input" id="mylaydate" <if condition="$formget.start gt 1"> value="{:date('Y-m-d H:i:s',$formget.start)} ~ {:date('Y-m-d H:i:s',$formget.end)}" </if> readonly placeholder="最后登录时间范围查询">
		        <input type='hidden' name="start"  id="lay_start_time" readonly value="{$formget.start}">
		        <input type='hidden' name="end"   id="lay_end_time" readonly value="{$formget.end}">
		 	  </div>
		 	  
			<div class="layui-inline ml10" >
				<button class="layui-btn layui-btn-normal">
					<i class="layui-icon">&#xe615;</i>&nbsp;&nbsp;点击搜索
				</button>
			</div>
			<div class="layui-inline fr ml10" >
				<button class="layui-btn layui-btn-normal" id="refresh_wrapper">
					<i class="layui-icon">&#xe666;</i>
				</button>
			</div>
			<div class="layui-inline fr ml10 mr10" >
				<a  onclick="iframe('{:url(\'Admin/useradd\')}','添加新后台管理员','580px','450px')"  class="layui-btn layui-btn-danger" >
					<i class="layui-icon">&#xe608;</i>&nbsp;&nbsp;添加新管理员
				</a>
			</div>
		<div class="clear"></div>
		</form>
	</blockquote>
	<div class="layui-field-box">
	  <form class="layui-form">
		<table id="dnd-example"  class="site-table table-hover">
			<thead>
				<tr>
					<th>角色分组</th>
					<th>登录账号</th>
					<th>管理员昵称</th>
					<th>代理城市</th>
					<th>注册时间</th>
					<th>最后登录时间</th>
					<th>启用状态</th>
					<th style="width:15%">操作</th>
				</tr>
			</thead>
			<tbody>
			{$categorys}
			</tbody>
		</table>
	  </form>
	</div>
 	<if condition="$allpage gt 1">
		<div class="admin-table-page">
			<div id="mylaypage" ></div>
		</div>
	 </if> 
</div>
<script>
//    function add(_id) {
//        var url="{:url('Admin/roleJurisdiction',['id'=>ukid])}";
//        url = url.replace('ukid',_id);
//        var index =layer.open({
//            type : 2,
//            title : '增加',
//            //maxmin : true,
//            shadeClose : false, // 点击遮罩关闭层
//            area : [ '800px', '520px' ],
//            content :url // iframe的url
//        });
//        layer.full(index);
//        //改变窗口大小时，重置弹窗的宽高，防止超出可视区域（如F12调出debug的操作）
//        $(window).on("resize",function(){
//            layer.full(index);
//        })
//    }
  myjumppage = "{:url('Admin/user',['page'=>'pageval','limits'=>'limitval','user_login'=>$formget.user_login,'start'=>$formget.start,'end'=>$formget.end,'role_id'=>$formget.role_id])}";
</script>
<include file="public/footer" />
<script src="__ADMIN__/js/jquery.treeTable.js" 					type="text/javascript" ></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#dnd-example").treeTable();

		$("#dnd-example .folder").each(function() {
			$($(this).parents("tr")[0]).droppable({
				accept: ".file, .folder",
				drop: function(e, ui) {
					$($(ui.draggable).parents("tr")[0]).appendBranchTo(this);
				},
				hoverClass: "accept",
				over: function(e, ui) {
					if(this.id != ui.draggable.parents("tr.parent")[0].id && !$(this).is(".expanded")) {
						$(this).expand();
					}
				}
			});
		});

		$("table#dnd-example tbody tr").mousedown(function() {
			$("tr.selected").removeClass("selected"); // Deselect currently selected rows
			$(this).addClass("selected");
		});
		$("table#dnd-example tbody tr span").mousedown(function() {
			$($(this).parents("tr")[0]).trigger("mousedown");
		});
	});
</script>
<script>
	form.render();
	//监听switch
	form.on('switch(category)', function(data) {
		var url=$(data.elem).attr("data-action");
		var id = data.elem.id;
		$.getJSON(url,function(result){
			if(result.code == 1){
				layer.msg(result.msg);
			}else if(result.code == 0){
				$("#"+id).removeAttr("checked")
				$("#"+id).next().removeClass("layui-form-onswitch");
				layer.msg(result.msg);
			}else if(result.code == 2){
				layer.alert(result.msg,{
					closeBtn: 0,
					btn: ['确认'],
				}, function() {
					reloadPage(window);
				});
			}
		});
	});
</script>
</body>

</html>